#ifndef SRC_WRITEBLF_H
#define SRC_WRITEBLF_H
#include <cstdint>
#include <mutex>
 #include "ycblf.h"
#include "BLF.h"

class Writeblf {
public:
    explicit Writeblf(const char* file_name);
    ~Writeblf();

    int32_t StartWriteBlf();
    int32_t BlfWriteCanData(CanData frame);
    int32_t BlfWriteCanfdData(CanData frame);
    int32_t BlfWriteFlexrayData(const FlexrayData& frame);
    bool FileStat();
    int32_t EndWriteBlf();
private:
    std::string file_name_{};
    Vector::BLF::File file_{};
    uint64_t file_start_time_;
    std::shared_ptr<std::mutex> mtx_;
};

#endif //SRC_WRITEBLF_H
